﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Acms.Bll;
using Acms.DataControls;

public partial class Templates_Generic_FeedModule : System.Web.UI.UserControl
{
    protected override void OnInit(EventArgs e)
    {
        base.OnInit(e);
        dsList.SelectData += new EventHandler<Acms.DataControls.SelectEventArgs<Acms.Bll.Post>>(dsList_SelectData);
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
        }
    }


    public string Title { get; set; }

    public string TitleUrl { get; set; }

    public int PageSize
    {
        get { return dlFeed.PageSize; }
        set { dlFeed.PageSize = value; }
    }

    public bool AllowPaging
    {
        get { return dlFeed.AllowPaging; }
        set { dlFeed.AllowPaging = value; }
    }

    public void Rebind()
    {
        dlFeed.DataBind();
    }

    protected override object SaveViewState()
    {
        ViewState["Title"] = Title;
        ViewState["TitleUrl"] = TitleUrl;
        return base.SaveViewState();
    }

    protected override void LoadViewState(object savedState)
    {
        base.LoadViewState(savedState);
        Title = ViewState["Title"] as string;
        TitleUrl = ViewState["TitleUrl"] as string;
    }

    void dsList_SelectData(object sender, Acms.DataControls.SelectEventArgs<Acms.Bll.Post> e)
    {
        if (this.SelectData != null)
        {
            SelectData(sender, e);
        }
    }

    public event EventHandler<SelectEventArgs<Post>> SelectData;
}

